package com.demo.provider1.controller;

import com.demo.common.bean.Book;
import com.demo.provider1.service.impl.Provider1ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: xiaoxiangjie
 * @Description:
 * @Date: 2021/3/21
 */
@RestController
@RequestMapping("provider1Controller")
public class Provider1Controller {

    @Autowired
    private Provider1ServiceImpl provider1Service;

    @GetMapping("/getBookInfo")
    public List<Book> getBookInfo(@RequestParam String name) {

        Book book = new Book();
        book.setName(name);
        return provider1Service.getBookInfo(book);

    }

    @PostMapping("/addBookInfo")
    public String addBookInfo(@RequestBody Book book) {

        return provider1Service.addBookInfo(book);

    }
}
